/* ============================================
   SMART OASIS 2.0 — Dashboard Styles
   ============================================ */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    /* body itself stays clipped — sidebar is fixed */
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface-dark);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: var(--z-nav);
    transition: width var(--duration-normal) var(--ease-out);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-version,
.sidebar.collapsed .sidebar-item span,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-back span {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-small);
    white-space: nowrap;
}

.sidebar-version {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--teal-accent);
    background: var(--teal-glow);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--fs-small);
    font-weight: 500;
    transition: all var(--duration-fast) ease;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.sidebar-item:hover {
    background: var(--surface-mid);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--teal-glow);
    color: var(--teal-bright);
    border: 1px solid rgba(0, 229, 200, 0.15);
}

.sidebar-item svg {
    flex-shrink: 0;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--status-infested);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-back {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-dim);
    font-size: var(--fs-xs);
    transition: all var(--duration-fast) ease;
}

.sidebar-back:hover {
    background: var(--surface-mid);
    color: var(--text-secondary);
}

/* ── TOPBAR ── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: var(--z-sticky);
    transition: left var(--duration-normal) var(--ease-out);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.topbar-toggle {
    display: none;
    padding: 8px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

.topbar-toggle:hover {
    background: var(--surface-mid);
    color: var(--text-primary);
}

.topbar-farm-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
}

.topbar-farm-selector select {
    background: var(--surface-mid);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: var(--font-body);
    font-size: var(--fs-small);
    outline: none;
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar-status-text {
    font-size: var(--fs-xs);
    color: var(--status-healthy);
    font-weight: 500;
}

.topbar-time {
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.topbar-notification {
    position: relative;
    padding: 8px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) ease;
}

.topbar-notification:hover {
    background: var(--surface-mid);
    color: var(--text-primary);
}

.notif-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--status-infested);
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-accent), var(--teal-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--navy-deep);
}

/* ── LANGUAGE TOGGLE (dashboard) ── */
.dashboard-body .lang-toggle,
.topbar .lang-toggle {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--teal-accent);
    background: rgba(0, 229, 200, 0.08);
    border: 1px solid rgba(0, 229, 200, 0.2);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    white-space: nowrap;
    letter-spacing: 0;
    flex-shrink: 0;
}

.dashboard-body .lang-toggle:hover,
.topbar .lang-toggle:hover {
    background: rgba(0, 229, 200, 0.15);
    border-color: var(--teal-accent);
    color: var(--teal-bright);
}

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: var(--space-xl);
    flex: 1;
    height: calc(100vh - var(--topbar-height));
    overflow-y: scroll;
    overflow-x: hidden;
    transition: margin-left var(--duration-normal) var(--ease-out);
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 200, 0.25) transparent;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 200, 0.25);
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 200, 0.5);
}

/* ── PANELS ── */
.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

.panel-header {
    margin-bottom: var(--space-xl);
}

.panel-header h2 {
    font-size: var(--fs-h2);
    margin-bottom: 4px;
}

.panel-subtitle {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

/* ── GRID LAYOUTS ── */
.overview-grid,
.das-grid,
.dts-grid,
.hyper-grid,
.fusion-grid,
.alerts-grid,
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--panel-gap);
}

.overview-grid {
    grid-template-columns: repeat(4, 1fr);
}

.map-grid {
    display: grid;
    gap: var(--panel-gap);
}

.span-2 {
    grid-column: span 2;
}

.span-full {
    grid-column: 1 / -1;
}

/* ── STAT CARDS ── */
.stat-card {
    padding: var(--space-lg);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.stat-card-label {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.stat-big-number {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.stat-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-break-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.stat-break-item strong {
    margin-left: auto;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
}

/* ── GAUGE ── */
.gauge-container {
    display: flex;
    justify-content: center;
}

.gauge {
    width: 120px;
    height: 120px;
}

.gauge-bg {
    fill: none;
    stroke: var(--surface-mid);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--teal-bright);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: calc(2 * 3.14159 * 50);
    stroke-dashoffset: calc(2 * 3.14159 * 50 * (1 - var(--progress, 0)));
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 1s var(--ease-out);
}

.gauge-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    fill: var(--teal-bright);
    text-anchor: middle;
}

.gauge-label {
    font-size: 0.65rem;
    fill: var(--text-dim);
    text-anchor: middle;
}

.mini-gauge {
    width: 80px;
    height: 80px;
}

.mini-gauge .gauge-bg {
    stroke-width: 6;
    r: 32;
}

.mini-gauge .gauge-fill {
    stroke-width: 6;
    stroke-dasharray: calc(2 * 3.14159 * 32);
    stroke-dashoffset: calc(2 * 3.14159 * 32 * (1 - var(--progress, 0)));
}

.gauge-value-sm {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 800;
    fill: var(--teal-bright);
    text-anchor: middle;
    dominant-baseline: middle;
}

/* ── ALERT BADGES ── */
.alert-badges {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.alert-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: var(--fs-small);
    font-weight: 500;
}

.alert-badge span {
    font-family: var(--font-mono);
    font-size: var(--fs-h4);
    font-weight: 800;
}

.alert-badge.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-infested);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.alert-badge.warning {
    background: rgba(245, 166, 35, 0.1);
    color: var(--status-watch);
    border: 1px solid rgba(245, 166, 35, 0.15);
}

.alert-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* ── QUICK STATS ── */
.quick-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-stat-value {
    font-family: var(--font-mono);
    font-size: var(--fs-h4);
    font-weight: 700;
    color: var(--teal-bright);
}

.quick-stat-label {
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

/* ── CHART CARDS ── */
.chart-card {
    padding: var(--space-lg);
    min-height: 200px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chart-header h3 {
    font-size: var(--fs-body);
    font-weight: 600;
}

.chart-legend {
    display: flex;
    gap: var(--space-md);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.chart-annotation {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    margin-top: var(--space-sm);
    font-style: italic;
}

.chart-annotation strong {
    color: var(--teal-accent);
}

.chart-card canvas {
    width: 100%;
    max-height: 280px;
}

/* ── CONTROL SELECT ── */
.control-select {
    background: var(--surface-dark);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    outline: none;
    cursor: pointer;
}

/* ── DAS CLASSIFICATION ── */
.classification-result {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.class-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.class-label {
    width: 60px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.class-progress {
    flex: 1;
    height: 8px;
    background: var(--surface-mid);
    border-radius: 4px;
    overflow: hidden;
}

.class-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s var(--ease-out);
}

.class-fill.healthy {
    background: var(--status-healthy);
}

.class-fill.suspect {
    background: var(--status-watch);
}

.class-fill.infested {
    background: var(--status-infested);
}

.class-value {
    width: 36px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.class-verdict {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(245, 166, 35, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.15);
    border-radius: var(--radius-md);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.class-verdict strong {
    color: var(--status-watch);
}

/* ── FIBER LOOP ── */
.fiber-loop {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.fiber-segment {
    flex: 1;
    min-width: 6px;
    max-width: 10px;
    border-radius: 2px;
    transition: height 0.3s ease;
}

/* ── DTS ── */
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

.hm-gradient {
    width: 120px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #2563eb, #06b6d4, #22c55e, #eab308, #f97316, #ef4444);
}

.hm-label {
    font-family: var(--font-mono);
}

.anomaly-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.anomaly-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.anomaly-item.critical {
    border-color: rgba(239, 68, 68, 0.2);
}

.anomaly-item.warning {
    border-color: rgba(245, 166, 35, 0.2);
}

.anomaly-item.info {
    border-color: rgba(59, 130, 246, 0.2);
}

.anomaly-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.anomaly-info strong {
    font-size: var(--fs-small);
    display: block;
    margin-bottom: 2px;
}

.anomaly-info span {
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

/* ── HYPERSPECTRAL ── */
.spectral-viewer {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.spectral-image {
    width: 100%;
    height: auto;
    display: block;
}

.spectral-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.band-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* ── DATA TABLE ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-xs);
}

.data-table thead th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 8px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.detection-log-wrapper {
    max-height: 300px;
    overflow-y: auto;
}

/* ── FUSION PIPELINE ── */
.pipeline-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    flex-wrap: wrap;
}

.pipe-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.pipe-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--fs-small);
    font-weight: 700;
}

.pipe-icon.das {
    background: rgba(0, 229, 200, 0.1);
    color: var(--teal-bright);
    border: 1px solid rgba(0, 229, 200, 0.2);
}

.pipe-icon.dts {
    background: rgba(245, 166, 35, 0.1);
    color: var(--status-watch);
    border: 1px solid rgba(245, 166, 35, 0.2);
}

.pipe-icon.hyper {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.pipe-icon.core-icon {
    background: rgba(0, 229, 200, 0.15);
    color: var(--teal-bright);
    border: 1px solid rgba(0, 229, 200, 0.3);
}

.pipe-icon.result-icon {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-healthy);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pipe-label {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    text-align: center;
    line-height: 1.4;
}

.pipe-arrow {
    font-size: 1.2rem;
    color: var(--text-dim);
    animation: arrow-pulse 2s ease infinite;
}

@keyframes arrow-pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
        color: var(--teal-bright);
    }
}

/* ── MODEL METRICS ── */
.model-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    text-align: center;
}

.metric-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.metric-gauge span {
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

/* ── THROUGHPUT ── */
.throughput-display {
    text-align: center;
}

.throughput-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--teal-bright);
    line-height: 1;
}

.throughput-label {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    margin-bottom: var(--space-md);
}

/* ── FARM MAP ── */
.map-container {
    position: relative;
}

.map-controls {
    display: flex;
    gap: 4px;
}

.map-filter-btn {
    padding: 4px 12px;
    font-size: var(--fs-xs);
    border-radius: var(--radius-full);
    background: var(--surface-mid);
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all var(--duration-fast) ease;
}

.map-filter-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.map-filter-btn.active {
    background: var(--teal-glow);
    color: var(--teal-bright);
    border-color: rgba(0, 229, 200, 0.2);
}

.farm-map {
    display: grid;
    grid-template-columns: repeat(40, 1fr);
    gap: 2px;
    padding: var(--space-md) 0;
    min-height: 300px;
}

.tree-dot {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    min-width: 6px;
}

.tree-dot:hover {
    transform: scale(2);
    z-index: 10;
    box-shadow: 0 0 8px currentColor;
}

.tree-dot.healthy {
    background: var(--status-healthy);
    opacity: 0.6;
}

.tree-dot.watch {
    background: var(--status-watch);
    opacity: 0.9;
}

.tree-dot.suspect {
    background: var(--status-suspect);
    opacity: 1;
}

.tree-dot.infested {
    background: var(--status-infested);
    opacity: 1;
    animation: dot-pulse 2s ease infinite;
}

.tree-dot.hidden {
    opacity: 0.05;
    pointer-events: none;
}

@keyframes dot-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
}

.map-legend {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    color: var(--text-dim);
}

/* ── TREE POPUP ── */
.tree-popup {
    position: fixed;
    top: 50%;
    right: var(--space-xl);
    transform: translateY(-50%);
    width: 280px;
    padding: var(--space-lg);
    z-index: var(--z-modal);
    animation: slideInRight 0.3s var(--ease-out);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: var(--fs-small);
    transition: all var(--duration-fast) ease;
}

.popup-close:hover {
    background: var(--surface-mid);
    color: var(--text-primary);
}

.tree-popup h4 {
    font-size: var(--fs-h4);
    margin-bottom: 4px;
}

.popup-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-small);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.popup-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-md);
}

.popup-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
}

.popup-row span {
    color: var(--text-dim);
}

.popup-row strong {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.popup-action {
    padding: var(--space-sm) var(--space-md);
    background: rgba(245, 166, 35, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.15);
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.popup-action strong {
    color: var(--status-watch);
}

/* ── ALERT FEED ── */
.alert-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 400px;
    overflow-y: auto;
}

.alert-feed-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--duration-fast) ease;
    cursor: pointer;
}

.alert-feed-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.alert-feed-item.critical {
    border-left: 3px solid var(--status-infested);
}

.alert-feed-item.warning {
    border-left: 3px solid var(--status-watch);
}

.alert-feed-item.info {
    border-left: 3px solid var(--status-info);
}

.alert-severity-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alert-details h4 {
    font-size: var(--fs-small);
    margin-bottom: 2px;
}

.alert-details p {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    line-height: 1.5;
}

.alert-meta {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    margin-top: 4px;
    font-family: var(--font-mono);
}

.alert-filters {
    display: flex;
    gap: 4px;
}

/* ── ACTIVITY FEED ── */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px var(--space-md);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.activity-time {
    font-family: var(--font-mono);
    color: var(--text-dim);
    min-width: 56px;
    flex-shrink: 0;
}

.activity-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ── REPORT PREVIEW ── */
.report-preview {
    display: flex;
    justify-content: center;
    padding: var(--space-md) 0;
}

.report-card {
    width: 100%;
    max-width: 320px;
    background: var(--surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.report-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--teal-accent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.report-body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
}

.report-row span {
    color: var(--text-dim);
}

.report-row strong {
    color: var(--text-secondary);
}

/* ── FLIGHT LOG ── */
.flight-log {
    max-height: 280px;
    overflow-y: auto;
}

/* ============================================
   RESPONSIVE DASHBOARD
   ============================================ */

@media (max-width: 1200px) {
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .model-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .farm-map {
        grid-template-columns: repeat(25, 1fr);
    }

    .pipeline-visual {
        gap: var(--space-sm);
    }
}

@media (max-width: 768px) {

    .overview-grid,
    .das-grid,
    .dts-grid,
    .hyper-grid,
    .fusion-grid,
    .alerts-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .span-full {
        grid-column: span 1;
    }

    .farm-map {
        grid-template-columns: repeat(20, 1fr);
    }

    .topbar-status,
    .topbar-time {
        display: none;
    }

    .map-legend {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .tree-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        transform: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}